﻿/*------------------------------------------------
// File Description: SortStack DataBase Entity
// Author:			 Crane
// Create Time:		 2020-12-26 15:18:31
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 组件分拣堆
    /// </summary>
    [Table(nameof(SortStack))]
    public class SortStack : BaseEntity
    {
        private string _workshopCode = string.Empty;
        private string _workshopName = string.Empty;
        private string _machineNo = string.Empty;
        private string _machineName = string.Empty;
        private string _lineName;

        #region Public Property

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 流水线ID
        ///</Summary>
        public int LineId { get; set; }

        ///<Summary>
        /// 流水线名称
        ///</Summary>
        public string LineName
        {
            get { return string.IsNullOrWhiteSpace(_lineName) ? string.Empty : _lineName; }
            set { _lineName = value; }
        }

        ///<Summary>
        /// 设备ID
        ///</Summary>
        public int MachineId { get; set; }

        ///<Summary>
        /// 设备编码
        ///</Summary>
        public string MachineNo
        {
            get { return string.IsNullOrWhiteSpace(_machineNo) ? string.Empty : _machineNo; }
            set { _machineNo = value; }
        }

        ///<Summary>
        /// 设备名称
        ///</Summary>
        public string MachineName
        {
            get { return string.IsNullOrWhiteSpace(_machineName) ? string.Empty : _machineName; }
            set { _machineName = value; }
        }

        ///<Summary>
        /// 堆号
        ///</Summary>
        public int StackNo { get; set; }

        ///<Summary>
        /// 满托数量
        ///</Summary>
        public int FullCount { get; set; }

        ///<Summary>
        /// 当前序号（1开始）
        ///</Summary>
        public int SortNo { get; set; }

        ///<Summary>
        /// 状态
        ///</Summary>
        public Enum.SortStackStatus Status { get; set; } = Enum.SortStackStatus.Sorting;
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 组件分拣堆
        /// </summary>
        public virtual DbSet<SortStack> SortStacks { get; set; }
    }
}